window.onload = function () {
    $('.checkall').click(function () {
        $('.xuan').attr("checked", this.checked)
    })
    $('.checkdel').click(function () {
        if (confirm('确定删除选中商品吗？')) {
            $('.xuan:checked').parent().parent().remove();
        }
    })
    $('.selfOrder-qupingjia').click(function () {
        window.location.href = "commentsManage.html"
    })
    $('.selfOrder-jiesuan').click(function () {
        window.location.href = "placeOrder.html"
    })

    var booktype = document.getElementsByClassName('book_type')
    var bookclass = document.getElementById('bookclass').children
    for (let i = 0; i < booktype.length; i++) {
        booktype[i].onclick = function () {
            for (var j = 0; j < bookclass.length; j++) {
                bookclass[j].className = ''
            }
            bookclass[i].className = 'active'
        }
    }
}